<!DOCTYPE html>
<html  lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    
    <title>shiro index</title>
    
</head>

<body>
	<input type="button" value="add" onclick="add()"/><br />
	<input type="button" value="del" onclick="del()" /><br />
	<input type="button" value="edit" onclick="edit()" /><br />
	<input type="button" value="sel" onclick="sel()" /><br />
	<input type="button" value="退出" onclick="logout()" /><br />
    
<!-- 全局js -->
<script src="static/js/jquery-1.9.1.min.js" ></script>
<script type="text/javascript">

	$(function(){
		
	});
	
	function add(){
		
		$.get("http://localhost:8080/add",function(data){
	        console.log(data);
	    });
	}
	
	function del(){
		$.ajax({
		    type: "post",
		    url: "http://localhost:8080/del",
		    success: function(data) {
		    	console.log(data)
		    },
		    error: function(){
		    	alert("error");
		    }
		});
	}
	
	function edit(){
		$.ajax({
		    type: "post",
		    url: "http://localhost:8080/edit",
		    success: function(data) {
		    	console.log(data)
		    },
		    error: function(){
		    	alert("error");
		    }
		});
	}
	
	function sel(){
		$.ajax({
		    type: "post",
		    url: "http://localhost:8080/sel",
		    success: function(data) {
		    	console.log(data)
		    },
		    error: function(){
		    	alert("error");
		    }
		});
	}
	
	function logout(){
		location.href = 'http://localhost:8080/logout';
	}

</script>
</body>
</html>
